//
//  FBSecViewController.m
//  VmiSJ
//
//  Created by 汪的一声就哭了！ on 2017/1/4.
//  Copyright © 2017年 汪的一声就哭了！. All rights reserved.
//

#import "FBSecViewController.h"

@interface FBSecViewController ()<UITableViewDelegate, UITableViewDataSource>
@property (nonatomic, strong) UITableView *tableView;
@end

@implementation FBSecViewController
{
    NSArray *_strArr;
}
- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    self.title = @"发布任务";
    _strArr = @[@"第一步",@"第二步",@"第三步",@"第四步",@"第五步",@"第六步",@"第七步"];
    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"添加步骤" style:UIBarButtonItemStyleDone target:self action:@selector(addStepAction:)];
    [self.navigationItem.rightBarButtonItem setTitleTextAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:self.fontSize]} forState:UIControlStateNormal];
    self.tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, WIDTH, HEIGHT-64-50) style:UITableViewStylePlain];
    _tableView.dataSource = self;
    _tableView.delegate = self;
    _tableView.backgroundColor = BackColor;
    _tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    
    [self.view addSubview:_tableView];
    [_tableView registerNib:[UINib nibWithNibName:@"WCSJTableViewCell" bundle:nil] forCellReuseIdentifier:@"cell1"];
    
    UIButton *nextStepBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    nextStepBtn.frame = CGRectMake(0, HEIGHT-64-50, WIDTH, 50);
    nextStepBtn.backgroundColor = Color;
    [nextStepBtn setAttributedTitle:[[NSAttributedString alloc] initWithString:@"下一步" attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:15], NSForegroundColorAttributeName:[UIColor whiteColor]}] forState:UIControlStateNormal];
    [self.view addSubview:nextStepBtn];
}
#pragma mark -------tableViewDataSource
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    WCSJTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell1"];
    cell.label.text = _strArr[indexPath.row];
    cell.backImageView.image = [UIImage imageNamed:@"我的_箭头"];
    cell.backgroundColor = [UIColor clearColor];
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    return cell;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 3;
}
#pragma mark ------- tableViewHeader

- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
    FBRWHeaderSectionView *view = [[FBRWHeaderSectionView alloc] init];
    view.label.text = @"添加任务步骤（最多可添加7步）";
    return view;
}
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
    return 45;
}

#pragma mark ------------- 添加步骤
- (void)addStepAction:(UIBarButtonItem *)btn
{
    
}
@end
